package com.nondo.dean.product.mapper;

import com.nondo.dean.product.domain.ProductStructure;
import com.nondo.dean.product.domain.ProductStructureExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface ProductStructureMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @SelectProvider(type=ProductStructureSqlProvider.class, method="countByExample")
    long countByExample(ProductStructureExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @DeleteProvider(type=ProductStructureSqlProvider.class, method="deleteByExample")
    int deleteByExample(ProductStructureExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Delete({
        "delete from product_structure",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Insert({
        "insert into product_structure (id, product_id, ",
        "product_code, product_name, ",
        "product_parent_code, product_unit, ",
        "product_no, product_quantity, ",
        "head_delete, item_delete, ",
        "create_by, create_date, ",
        "update_by, update_date, ",
        "remarks, del_flag)",
        "values (#{id,jdbcType=INTEGER}, #{productId,jdbcType=INTEGER}, ",
        "#{productCode,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, ",
        "#{productParentCode,jdbcType=VARCHAR}, #{productUnit,jdbcType=VARCHAR}, ",
        "#{productNo,jdbcType=VARCHAR}, #{productQuantity,jdbcType=INTEGER}, ",
        "#{headDelete,jdbcType=INTEGER}, #{itemDelete,jdbcType=INTEGER}, ",
        "#{createBy,jdbcType=BIGINT}, #{createDate,jdbcType=TIMESTAMP}, ",
        "#{updateBy,jdbcType=BIGINT}, #{updateDate,jdbcType=TIMESTAMP}, ",
        "#{remarks,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR})"
    })
    int insert(ProductStructure record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @InsertProvider(type=ProductStructureSqlProvider.class, method="insertSelective")
    int insertSelective(ProductStructure record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @SelectProvider(type=ProductStructureSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_parent_code", property="productParentCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_unit", property="productUnit", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_no", property="productNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_quantity", property="productQuantity", jdbcType=JdbcType.INTEGER),
        @Result(column="head_delete", property="headDelete", jdbcType=JdbcType.INTEGER),
        @Result(column="item_delete", property="itemDelete", jdbcType=JdbcType.INTEGER),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<ProductStructure> selectByExampleWithRowbounds(ProductStructureExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @SelectProvider(type=ProductStructureSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_parent_code", property="productParentCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_unit", property="productUnit", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_no", property="productNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_quantity", property="productQuantity", jdbcType=JdbcType.INTEGER),
        @Result(column="head_delete", property="headDelete", jdbcType=JdbcType.INTEGER),
        @Result(column="item_delete", property="itemDelete", jdbcType=JdbcType.INTEGER),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<ProductStructure> selectByExample(ProductStructureExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Select({
        "select",
        "id, product_id, product_code, product_name, product_parent_code, product_unit, ",
        "product_no, product_quantity, head_delete, item_delete, create_by, create_date, ",
        "update_by, update_date, remarks, del_flag",
        "from product_structure",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_parent_code", property="productParentCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_unit", property="productUnit", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_no", property="productNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_quantity", property="productQuantity", jdbcType=JdbcType.INTEGER),
        @Result(column="head_delete", property="headDelete", jdbcType=JdbcType.INTEGER),
        @Result(column="item_delete", property="itemDelete", jdbcType=JdbcType.INTEGER),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    ProductStructure selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @UpdateProvider(type=ProductStructureSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ProductStructure record, @Param("example") ProductStructureExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @UpdateProvider(type=ProductStructureSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ProductStructure record, @Param("example") ProductStructureExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @UpdateProvider(type=ProductStructureSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ProductStructure record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_structure
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Update({
        "update product_structure",
        "set product_id = #{productId,jdbcType=INTEGER},",
          "product_code = #{productCode,jdbcType=VARCHAR},",
          "product_name = #{productName,jdbcType=VARCHAR},",
          "product_parent_code = #{productParentCode,jdbcType=VARCHAR},",
          "product_unit = #{productUnit,jdbcType=VARCHAR},",
          "product_no = #{productNo,jdbcType=VARCHAR},",
          "product_quantity = #{productQuantity,jdbcType=INTEGER},",
          "head_delete = #{headDelete,jdbcType=INTEGER},",
          "item_delete = #{itemDelete,jdbcType=INTEGER},",
          "create_by = #{createBy,jdbcType=BIGINT},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_by = #{updateBy,jdbcType=BIGINT},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "del_flag = #{delFlag,jdbcType=CHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ProductStructure record);
}